package com.mobileClientKernel.android.serviceLayer.httpTransportService.model;

import com.mobileClientKernel.android.commonLayer.JSONUtil;

import java.io.Serializable;
import java.util.List;
import org.json.JSONObject;

/**
 * Created by gongjian on 2018/4/28.
 */

public class JJTBaseModel implements Serializable, IJJTBaseModel {

    private String response_code;
    private String response_msg;
    private String response_dateTime;

    private List<Object> response_dataList; // the value for "data" key is array
    private String response_dataString; // the value for "data" key is string

    @Override
    public boolean isValid() {
        //boolean isSuccess = "0000".equals(response_code);
        boolean isSuccess = true;
        return isSuccess;
    }

    @Override
    public String getMsg() {

        return response_msg;
    }

    public String getCode(){
        return response_code;
    }

    @Override
    public void setData(JSONObject jsonObject) {
        response_code = JSONUtil.getString(jsonObject, "code");
        response_msg = JSONUtil.getString(jsonObject, "msg");
        response_dateTime = JSONUtil.getString(jsonObject, "dateTime");
    }

    @Override
    public void setResponseDataArray(List<Object> objectList) {
        response_dataList = objectList;
    }

    @Override
    public void setResponseDataString(String string) {
        response_dataString = string;
    }
}

